/*
 * @Descripttion:
 * @version:
 * @Author: ChenXiang
 * @Date: 2021-04-10 17:13:52
 * @LastEditors: ChenXiang
 * @LastEditTime: 2021-06-01 19:10:12
 */
import { useState } from "react";
import utils from "@utils";

const useInput = (props) => {
  const { value } = props;
  const [text, setText] = useState(value);
  const onChange = (e) => {
    setText(e);
  };

  return { ...props, value: text, onChange, setText }; // also added inputRef as an output so I can consume it
};

export default useInput;
